
#include "CommonEntities.h"

#include <SDL2/SDL_opengl.h>

#include <ALittleClient/LogSystem/LogSystem.h>

namespace ALittle
{

CommonEntities::CommonEntities()
{ }

CommonEntities::~CommonEntities()
{ }

void CommonEntities::AddChild(CommonEntity* entity)
{
	if (entity == NULL)
	{
		ALITTLE_ERROR("entity is null!");
		return;
	}
	m_entity_list.push_back(entity);
}

void CommonEntities::RemoveChild(CommonEntity* entity)
{
	if (entity == NULL)
	{
		ALITTLE_ERROR("entity is null!");
		return;
	}

	m_entity_list.remove(entity);
}

void CommonEntities::Draw()
{
	CommonEntityList::iterator it, end = m_entity_list.end();
	for (it = m_entity_list.begin(); it != end; ++it)
		(*it)->Render();
}

} // ALittle
